package com.vue3.blog.web;

import com.vue3.blog.common.resp.Result;
import com.vue3.blog.domain.vo.ArchiveArticleVO;
import com.vue3.blog.domain.vo.ArchiveVO;
import com.vue3.blog.service.IArchiveService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Mr.小朱同学
 * @version 1.0.0
 * @date 2025/6/17 11:14
 * @description 文章归档
 */
@RequestMapping("/api/archive")
@RestController
public class ArchiveController {
    @Resource
    private IArchiveService archiveService;

    @GetMapping("/date")
    public Result<List<ArchiveVO>> getArchiveList() {
        return Result.success("文章归档", archiveService.getArchiveList());
    }

    @GetMapping("/timeline")
    public Result<List<ArchiveArticleVO>> getArchiveArticleList() {
        return Result.success("文章归档时间线", archiveService.getArchiveArticleList());
    }

}